!{include file='common/iheader.htm'}
<style>
	.base_desc{line-height:20px;}
</style>
<div id="i_nav">
	<h3 class="page_title">!{$cate_name}分类编辑</h3>
	<a class="button" href="/manager.php?app=!{$cate_code}">!{$cate_name}管理</a> 
	<a class="button" href="/manager.php?app=!{$cate_code}&act=edit">添加!{$cate_name}</a>
	<a class="button" href="/manager.php?app=!{$cate_code}_cate">!{$cate_name}分类管理</a>
	!{if $cate}
	<a class="button" href="/manager.php?app=!{$cate_code}_cate&act=edit">添加分类</a> 
	!{/if}
</div>
<form method="post">
	<div class="tabs">
		<ul class="tab_title">
			<li><a href="#base">基本信息</a></li>
			<li><a href="#base_desc">描述信息</a></li>
			<li><a href="#adv">高级信息</a></li>
			!{if $cate}
			<li><a href="#refer">关联信息</a></li>
			<li><a href="#ext">扩展信息</a></li>
			!{/if}
		</ul>
		<div id="base">
			<div class="form_item">
				<strong>分类名称：</strong>
				<div><input class="text_input" maxlength="50" type="text" name="name" value="!{$cate.name}"/></div>
				<p>(分类名称长度应该在1至50之间)</p>
			</div>
			<div class="form_item">
				<strong>上级分类：</strong>
				<div>
					<select name="parent">
						<option value="0">--顶级分类--</option>
						!{html_options options=$cate_tree selected=$parent}
					</select>
				</div>
			</div>
			<div class="form_item">
				<strong>保存目录 ：</strong>
				<div>
					!{if !$cate.path}
					<select name="base_path">
						<option value="parent_base">基于上级目录</option>
						<option value="site_base">基于网站根目录</option>
					</select> / 
					!{/if}
					<input class="text_input" type="text" name="path" value="!{$cate.path}"/> 
					!{if !$cate.path}
					<label><input type="checkbox" name="pinyin" value="1"/> 拼音</label>
					!{/if}
				</div>
				<p>(分类下的文章保存路径)</p>
			</div>
			<div class="form_item">
				<strong>阅读权限：</strong>
				<div>
					!{html_checkboxes options=$user_levels name="user_level" checked=$cate.user_level}
				</div>
				<p>(只有选中的用户才有阅读权限，不选表示不作限制)</p>
			</div>
			<div class="form_item">
				<strong>　属性组：</strong>
				<div>
					!{foreach from=$cate.attr_groups item=attr key=attr_id name=c}
					<select name="attrs[]">
						!{html_options options=$attrs selected=$attr_id}
						!{if $smarty.foreach.c.index gt 0}
						<option value="-1">--删除属性组--</option>
						!{/if}
					</select> 
					!{foreachelse}
					<select name="attrs[]">
						<option value="0">--属性组--</option>
						!{html_options options=$attrs}
					</select> 
					!{/foreach}
				</div>
				<p></p>
			</div>
		</div>
		<div id="base_desc">
			!{wysiwyg}
			<div class="base_desc">
				<textarea name="desc" class="wysiwyg" style="width:100%;height:240px;">!{$cate.desc}</textarea>
			</div>
		</div>
		<div id="adv">
			<div class="form_item">
				<strong>SEO标题：</strong>
				<div><input class="text_input" name="seo_title" type="text" value="!{$cate.seo_title}"/></div>
				<p>(用于列表或频道页面默认页面标题)</p>
			</div>
			<div class="form_item">
				<strong>SEO描述：</strong>
				<div><input class="text_input" name="seo_description" type="text" value="!{$cate.seo_description}"/></div>
				<p>(用于列表或频道页面默认页面mate标签的descriptoin值)</p>
			</div>
			<div class="form_item">
				<strong>SEO关键字：</strong>
				<div><input class="text_input" name="seo_keywords" type="text" value="!{$cate.seo_keywords}"/></div>
				<p>(用于列表或频道页面默认页面mate标签的keywords值)</p>
			</div>
			<div class="form_item">
				<strong>频道首页模板：</strong>
				<div><input class="text_input" name="template_index" value="!{$cate.template.template_index|default:'article.index.htm'}" type="text"/></div>
				<p>(前端频道首页显示使用的模板)</p>
			</div>
			<div class="form_item">
				<strong>分类列表模板：</strong>
				<div><input class="text_input" name="template_list" value="!{$cate.template.template_list|default:'article.list.htm'}" type="text"/></div>
				<p>(前端频道列表页面显示使用的模板)</p>
			</div>
			<div class="form_item">
				<strong>分类内容模板：</strong>
				<div><input class="text_input" name="template_detail" value="!{$cate.template.template_detail|default:'article.detail.htm'}" type="text"/></div>
				<p>(前端频道内容页面显示使用的模板)</p>
			</div>
		</div>
		!{if $cate}
		<div id="refer">
			<h3>图片：</h3>
			<h3>文章：</h3>
			<h3>商品：</h3>
		</div>
		<div id="ext">
			<a href="javascript:void(0)" class="self_attr">添加属性</a>
		</div>
		!{/if}
	</div>
	
	<div class="form_item form_btn_item">
		<input type="hidden" name="id" value="!{$cate._id|default:0}"/>
		<input class="button" type="submit" value="保存" />
	</div>
</form>
!{include file='common/self_attr.htm'}
<script src="!{res file='js/jquery_plus/jquery.form.js'}"></script>
<script>
	$(function(){
		$('input[name="pinyin"]').click(function(){
			if($('input[name="pinyin"]:checked').length){
				$("input[name='path']").hide();
			}else{
				$("input[name='path']").show();
			}
		});
		$("select[name='attrs[]']").yu_selector();
	});
</script>
!{include file='common/ifooter.htm'}